﻿Public Class AI

    Property Value1 As Integer
    Property Value2 As Integer
    Property Value3 As Integer
    Property Value4 As Integer
    Property Value5 As Integer
    Property Value6 As Integer
    Property Value7 As Integer

    Public Sub Load(stream As IO.StreamReader)

        Dim shouldExit As Boolean = False
        Dim data As LineData

        Do Until shouldExit OrElse stream.EndOfStream
            data = ReadLineData(stream)

            Select Case data.LineType

                Case DataLineType.EndBlockChar
                    shouldExit = True
                Case DataLineType.StarBlockChar
                    ' skip
                Case DataLineType.KeyValue

                    Select Case data.KeyValueData.Key
                        Case Else
                            AddSkipedLine(data.OriginalText)
                    End Select

                Case DataLineType.InLine
                    Value1 = Decimal.Parse(data.InLineData.Values(0), Globalization.CultureInfo.InvariantCulture)
                    Value2 = Decimal.Parse(data.InLineData.Values(1), Globalization.CultureInfo.InvariantCulture)
                    Value3 = Decimal.Parse(data.InLineData.Values(2), Globalization.CultureInfo.InvariantCulture)
                    Value4 = Decimal.Parse(data.InLineData.Values(3), Globalization.CultureInfo.InvariantCulture)
                    Value5 = Decimal.Parse(data.InLineData.Values(4), Globalization.CultureInfo.InvariantCulture)
                    Value6 = Decimal.Parse(data.InLineData.Values(5), Globalization.CultureInfo.InvariantCulture)
                    Value7 = Decimal.Parse(data.InLineData.Values(6), Globalization.CultureInfo.InvariantCulture)
                    shouldExit = data.InLineData.WithEndOfBlock
                Case Else
                    AddSkipedLine(data.OriginalText)
            End Select
        Loop
    End Sub

End Class
